<template>
  <el-row>
    <el-col :span="4">
      <el-select size="mini" v-model="data.type">
        <el-option label="设备属性" value="property" key="property"></el-option>
        <el-option label="设备标签" value="tag" key="tag"></el-option>
      </el-select>
    </el-col>
    <el-col :span="8">
      <el-input
        size="mini"
        v-model="data.identifier"
        auto-complete="off"
      ></el-input>
    </el-col>
    <el-col :span="4">
      <el-select size="mini" v-model="data.comparator">
        <el-option
          v-for="cp in compares"
          :label="cp.name"
          :value="cp.value"
          :key="cp.value"
        ></el-option>
      </el-select>
    </el-col>
    <el-col :span="4">
      <el-input size="mini" v-model="data.value" auto-complete="off"></el-input>
    </el-col>
  </el-row>
</template>

<script>
export default {
  name: "FilterCondition",
  props: {
    data: {
      type: Object,
      default: () => {
        return {
          device: "",
          type: "property",
          identifier: "",
          value: "",
          comparator: "",
        };
      },
    },
  },
  data() {
    return {
      inEdit: false,
      compares: [
        {
          name: "大于",
          value: ">",
        },
        {
          name: "等于",
          value: "==",
        },
        {
          name: "小于",
          value: "<",
        },
        {
          name: "不等于",
          value: "!=",
        },
        {
          name: "包含",
          value: "in",
        },
        {
          name: "不包含",
          value: "notin",
        },
        {
          name: "相似",
          value: "like",
        },
      ],
    };
  },
  components: {},
  created() {},
  methods: {},
};
</script>
